package com.zty.prince.tuangou.utils;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by Prince on 2017/6/22.
 */
public class SPUtil {
    public static final String spName = "TuanGou";
    public static SharedPreferences sp;

    public static void putFirstBoolean(Context context,String key,boolean ifFirst){
        if (sp == null){
            sp = context.getSharedPreferences(spName,Context.MODE_PRIVATE);
        }
        sp.edit().putBoolean(key,ifFirst).commit();
    }

    public static boolean getFirstBoolean(Context context,String key,boolean defValue){
        if (sp ==null){
            sp = context.getSharedPreferences(spName,Context.MODE_PRIVATE);
        }
        return sp.getBoolean(key,defValue);
    }
}
